package cn.simon.free.logtrack.core;

import cn.simon.free.logtrack.properties.LogTrackProperties;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @author simon
 * @date 2021/4/17 14:45
 * @copyright:
 * @modifier
 * @motto a no talent, people who have to study hard
 */
@Component
@ConditionalOnBean(LogTrackProperties.class)
@ConditionalOnProperty(prefix = "cn.glc.log-track", name = "enable", havingValue = "true")
@AllArgsConstructor
public class LogTrackInit {

    private final Logger log = LoggerFactory.getLogger(getClass());

    private final LogTrackProperties logTrackProperties;

    @PostConstruct
    public void init() {
        log.info("logTrack:[{}] loading over", logTrackProperties.getName());
    }
}
